;;;============================================================================
;;;
;;; Subject: Loading Digital Images Files
;;;         
;;;
;;;----------------------------------------------------------------------------
;;;
;;; Author: Jónathan Heras Vicente
;;;
;;;============================================================================

(IN-PACKAGE "COMMON-LISP-USER")

(DEFCONSTANT +DI-LIST+
    '("simplicial-complexes-optimize"
      "sc-to-ss"
      "list-to-sc"
      "pairs-to-nat"
      "pbm-list"
      "genera-tetrahedros"
      ))

(DO ((i 1 (1+ i))
     (mark +DI-LIST+ (cdr mark)))
    ((endp mark) (terpri))
   (format t "~% FILE ~2D: ~A" i (car mark)))

(DEFCONSTANT +SOURCE-EXTENSION-DI+
  #+(or allegro clisp lispworks) "cl"
  #-(or allegro clisp lispworks)
    (error "Not an Allegro or CLisp or LispWorks environment."))

(DEFCONSTANT +COMPILED-EXTENSION-DI+ 
    #+allegro "fasl"
    #+clisp "fas"
    #+lispworks "ofasl")

(DEFUN LOAD-DIFILES ()
   (mapc #'(lambda (file-name)
             (load (concatenate 'string file-name "." +SOURCE-EXTENSION-DI+)))
    +DI-LIST+))

(DEFVAR *CMBN-CONTROL-DI*)
(SETF *CMBN-CONTROL-DI* T)

(DEFUN COMPILE-DI-FILES ()
  (format t "~%*CMBN-CONTROL-DI*  = ~A~2%" *cmbn-control-di*)
  (mapc #'(lambda (file-name)
            (compile-file (concatenate 'string file-name "." +SOURCE-EXTENSION-DI+))
            (load (concatenate 'string file-name "." +compiled-extension-di+)))
    +DI-LIST+))

(DEFUN LOAD-DI-FILES ()
   (mapc #'(lambda (file-name)
             (load (concatenate 'string file-name "." +compiled-extension-di+)))
    +DI-LIST+))
